﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Serialization;

namespace BoriPeter.FatSecret.Models
{
    [XmlRoot("food_entries", Namespace = "http://platform.fatsecret.com/api/1.0/")]
    public class FoodEntriesGetModel
    {
        /// <summary>
        /// The food diary entry elements returned are those previously saved 
        /// by the user for the filter specified. Detailed nutritional information 
        /// is provided for each food diary entry as follows:
        /// </summary>
        [XmlElement("food_entry")]
        public FoodEntriesGetEntry[] Entries { get; set; }
    }

    public class FoodEntriesGetEntry
    {
        /// <summary>
        /// the unique identifier of the food diary entry.
        /// </summary>
        [XmlElement("food_entry_id")]
        public int FoodEntryId { get; set; }

        /// <summary>
        /// the full description of the food entry. E.G.: "1 cup Instant Oatmeal" or "100 g Corned Beef".
        /// </summary>
        [XmlElement("food_entry_description")]
        public string FoodEntryDescription { get; set; }

        /// <summary>
        /// is an Int – the date of the entry, see dateint. 
        /// </summary>
        [XmlElement("date_int")]
        public int DateInt { get; set; }

        /// <summary>
        /// the meal of the day, see meal_type.
        /// </summary>
        [XmlElement("meal")]
        public string Meal { get; set; }

        /// <summary>
        /// the unique food identier.
        /// </summary>
        [XmlElement("food_id")]
        public int FoodId { get; set; }

        /// <summary>
        /// the unique serving identifier, indicating the serving size nominated for the food diary entry.
        /// </summary>
        [XmlElement("serving_id")]
        public int ServingId { get; set; }

        /// <summary>
        /// is a Decimal - the number of units of the standard serving size consumed.
        /// </summary>
        [XmlElement("number_of_units")]
        public float NumberOfUnits { get; set; }


        /// <summary>
        /// a description of the food item as entered by the user; 
        /// typically the name of the food. E.G.: "Instant Oatmeal".
        /// </summary>
        [XmlElement("food_entry_name")]
        public string FoodEntryName { get; set; }

        /*******************************************************************/
        /* The complete nutritional information is returned - see nutrient */
        /*******************************************************************/
        /// <summary>
        /// calories is a Decimal – the energy content in kcal.
        /// </summary>
        [XmlElement("calories")]
        public decimal Calories { get; set; }

        /// <summary>
        /// carbohydrate is a Decimal – the total carbohydrate content in grams.
        /// </summary>
        [XmlElement("carbohydrate")]
        public decimal Carbohydrate { get; set; }

        /// <summary>
        /// protein is a Decimal – the protein content in grams.
        /// </summary>
        [XmlElement("protein")]
        public decimal Protein { get; set; }

        /// <summary>
        /// fat is a Decimal – the total fat content in grams.
        /// </summary>
        [XmlElement("fat")]
        public decimal Fat { get; set; }

        /// <summary>
        /// saturated_fat is a Decimal – the saturated fat content in grams (where available).
        /// </summary>
        [XmlElement("saturated_fat")]
        public decimal SaturatedFat { get; set; }

        /// <summary>
        /// polyunsaturated_fat is a Decimal – the polyunsaturated fat content in grams (where available).
        /// </summary>
        [XmlElement("polyunsaturated_fat")]
        public decimal PolyunsaturatedFat { get; set; }

        /// <summary>
        /// monounsaturated_fat is a Decimal – the monounsaturated fat content in grams (where available).
        /// </summary>
        [XmlElement("monounsaturated_fat")]
        public decimal MonounsaturatedFat { get; set; }

        /// <summary>
        /// trans_fat is a Decimal – the trans fat content in grams (where available).
        /// </summary>
        [XmlElement("trans_fat")]
        public decimal TransFat { get; set; }

        /// <summary>
        /// cholesterol is a Decimal – the cholesterol content in milligrams (where available).
        /// </summary>
        [XmlElement("cholesterol")]
        public decimal Cholesterol { get; set; }

        /// <summary>
        /// sodium is a Decimal – the sodium content in milligrams (where available).
        /// </summary>
        [XmlElement("sodium")]
        public decimal Sodium { get; set; }

        /// <summary>
        /// potassium is a Decimal – the potassium content in milligrams (where available).
        /// </summary>
        [XmlElement("potassium")]
        public decimal Potassium { get; set; }

        /// <summary>
        /// fiber is a Decimal – the fiber content in grams (where available).
        /// </summary>
        [XmlElement("fiber")]
        public decimal Fiber { get; set; }

        /// <summary>
        /// sugar is a Decimal – the sugar content in grams (where available).
        /// </summary>
        [XmlElement("sugar")]
        public decimal Sugar { get; set; }

        /// <summary>
        /// vitamin_a is an Int – the percentage of daily recommended Vitamin A, 
        /// based on a 2000 calorie diet (where available).
        /// </summary>
        [XmlElement("vitamin_a")]
        public int VitaminA { get; set; }


        /// <summary>
        /// vitamin_c is an Int – the percentage of daily recommended Vitamin C, 
        /// based on a 2000 calorie diet (where available).
        /// </summary>
        [XmlElement("vitamin_c")]
        public int VitaminC { get; set; }

        /// <summary>
        /// calcium is an Int – the percentage of daily recommended Calcium, 
        /// based on a 2000 calorie diet (where available).
        /// </summary>
        [XmlElement("calcium")]
        public int Calcium { get; set; }


        /// <summary>
        /// iron is an Int – the percentage of daily recommended Iron, 
        /// based on a 2000 calorie diet (where available).
        /// </summary>
        [XmlElement("iron")]
        public int Iron { get; set; }
    }
}
